package com.example.test.common;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.stereotype.Component;

@Component
public class SwaggerExtractor {

    private final OpenAPI openAPI;

    public SwaggerExtractor(OpenAPI openAPI) {
        this.openAPI = openAPI;
    }

    public void extractSwaggerInfo() {
        Info info = openAPI.getInfo();
        System.out.println("API 标题: " + info.getTitle());
        System.out.println("API 描述: " + info.getDescription());
        System.out.println("API 版本: " + info.getVersion());
    }
}
